﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using MVCManage.BLL;
using MVCManage.Model;
using MVCManage.Api.Models;


namespace MVCManage.Api.Controllers
{
    public class PderxqController : ApiController
    {
        // GET: api/Pderxq
        public ResultData<List<PderxqDto>> Get()
        {
            var zz = new PderxqBLL().Query().ToList();
            var tt = from n in zz
                     select new PderxqDto
                     {
                         Pbh = n.pbh,
                         Price = (float)n.price,
                         Pxqid = n.pxqid,
                         Shu = (int)n.shu,
                         Gid = n.gId,
                         Name = n.Goods.name,
                         Images = n.Goods.images,
                         Sfpl=n.sfpl,
                         Pl=n.pl,
                         zt=n.pder.zt,
                         
                     };
            ResultData<List<PderxqDto>> result = new ResultData<List<PderxqDto>>();
            result.code = 1;
            result.msg = "ok";
            result.data = tt.ToList();
            return result;
        }

        // GET: api/Pderxq/5
        public string Get(int id)
        {
            return "value";
        }

        // POST: api/Pderxq
        public void Post([FromBody]string value)
        {
        }

        // PUT: api/Pderxq/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE: api/Pderxq/5
        public void Delete(int id)
        {
        }
    }
}
